﻿<%@ Page Title="New Transaction" Language="C#" MasterPageFile="~/Backoffice/BackOffice.Master"
    AutoEventWireup="true" CodeBehind="TransactionsAdd.aspx.cs" Inherits="TreaShares.Backoffice.User.TransactionsAdd" %>

<%@ MasterType VirtualPath="~/Backoffice/BackOffice.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHead" runat="server">
    <script src="../../Scripts/TransactionAdd.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Stock </a></li>
            <li><a href="#tabs-2">Option </a></li>
        </ul>
        <div id="tabs-1">
            <table cellpadding="2" cellspacing="2">
                <tr>
                    <td style="width: 250px">
                        Transaction Date
                    </td>
                    <td>
                        <input type="text" id="txtTransactionDate" name="txtTransactionDate" value="" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Entity
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStockEntity" runat="server" DataSourceID="ObjectDataSource1"
                            DataTextField="ShortName" DataValueField="Id" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="Select" TypeName="TreaShares.Backoffice.Controlers.EntityManager">
                            <SelectParameters>
                                <asp:CookieParameter CookieName="OrganisationId" Name="ClientId" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:HyperLink ID="hlEntities" runat="server" NavigateUrl="~/Backoffice/User/Entities.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Counterparty
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStockCounterparty" runat="server" DataTextField="ShortName"
                            DataValueField="Id" DataSourceID="ObjectDataSource2" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="Select" TypeName="TreaShares.Backoffice.Controlers.CounterpartyManager">
                            <SelectParameters>
                                <asp:CookieParameter CookieName="OrganisationId" Name="ClientId" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Backoffice/User/Counterparties.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Transaction Ref
                    </td>
                    <td>
                        <input type="text" name="txtTransactionRef" id="txtTransactionRef" value="" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Buy/Sell
                    </td>
                    <td>
                        <div class="radio">
                            <input type="radio" name="rblStockBuySell" id="rbStockBuy" value="B" checked="checked"
                                class="Calc" /><label for="rbStockBuy">Buy</label><input type="radio" name="rblStockBuySell"
                                    id="rbStockSell" class="Calc" value="S" /><label for="rbStockSell">Sell</label></div>
                    </td>
                </tr>
                <tr>
                    <td>
                        Value Date
                    </td>
                    <td>
                        <input type="text" id="txtValueDate" name="txtValueDate" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Stock
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStock" runat="server" DataTextField="StockName" DataValueField="StockValue"
                            DataSourceID="ObjectDataSource3" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <input type="hidden" name="ddlStockSelected" id="ddlStockSelected" />
                        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="SelectDropdownt"
                            TypeName="TreaShares.Backoffice.Controlers.StocksManager">
                            <SelectParameters>
                                <asp:CookieParameter CookieName="OrganisationId" Name="ClientId" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Backoffice/User/Stocks.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Quantity
                    </td>
                    <td>
                        <input type="text" name="txtQuantity" id="txtQuantity" value="0" class="Calc" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Price <span class="GrayTextLight">(per share)</span>
                    </td>
                    <td>
                        <input type="text" name="txtPrice" id="txtPrice" value="0" class="Calc" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Fee <span class="GrayTextLight">(per share)</span>
                    </td>
                    <td>
                        <input type="text" name="txtPerShare" id="txtPerShare" value="0" class="Calc" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Flat fee
                    </td>
                    <td>
                        <input type="text" name="txtFlat" id="txtFlat" value="0" class="Calc" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Total Fees
                    </td>
                    <td>
                        <input type="text" name="txtTotalFees" id="txtTotalFees" value="0" readonly="readonly" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Total Consideration
                    </td>
                    <td>
                        <input type="text" name="txtTotalConsideration" id="txtTotalConsideration" value="0"
                            readonly="readonly" />
                        <span id="stockCurrency"></span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <span id="lblStockMsg" class="AlertText"></span>
                        <input type="reset" class="button" />
                        <input type="button" id="btnSaveStock" value="Save" class="button" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="tabs-2">
            <table cellpadding="2" cellspacing="2">
                <tr>
                    <td style="width: 250px">
                        Transaction Date
                    </td>
                    <td>
                        <input type="text" id="txtTransactionOptionDate" name="txtTransactionOptionDate"
                            value="" />
                    </td>
                    <td rowspan="12">
                        <ul id="ulOption" class="AlertText">
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td>
                        Entity
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlOptionEntity" runat="server" DataSourceID="ObjectDataSource1"
                            DataTextField="ShortName" DataValueField="Id" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/Backoffice/User/Entities.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Counterparty
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlOptionCounterparty" runat="server" DataTextField="ShortName"
                            DataValueField="Id" DataSourceID="ObjectDataSource2" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/Backoffice/User/Counterparties.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Transaction Ref
                    </td>
                    <td>
                        <input type="text" name="txtOptionTransactionRef" id="txtOptionTransactionRef" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Buy/Sell
                    </td>
                    <td>
                        <div class="radio">
                            <input type="radio" name="rblBuySell" id="rbOptionBuy" value="B" checked="checked" /><label
                                for="rbOptionBuy">Buy</label><input type="radio" name="rblBuySell" id="rbOptionSell"
                                    value="S" /><label for="rbOptionSell">Sell</label></div>
                    </td>
                </tr>
                <tr>
                    <td>
                        Value Date
                    </td>
                    <td>
                        <input type="text" id="txtOptionValueDate" name="txtOptionValueDate" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Vesting Date
                    </td>
                    <td>
                        <input type="text" id="txtVestingDate" name="txtVestingDate" class="datepicker" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Exercise Date
                    </td>
                    <td>
                        <input type="text" id="txtExerciseDate" name="txtExerciseDate" class="datepicker" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Stock
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlOptionStock" runat="server" DataTextField="StockName" DataValueField="StockValue"
                            DataSourceID="ObjectDataSource3" Width="190px" ClientIDMode="Static">
                        </asp:DropDownList>
                        <input type="hidden" name="txtOptionStockSelected" id="txtOptionStockSelected" />
                        <asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/Backoffice/User/Stocks.aspx"
                            CssClass="editButton"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td>
                        Quantity
                    </td>
                    <td>
                        <input type="text" name="txtOptionQuantity" id="txtOptionQuantity" value="0" class="Calc" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Strike
                    </td>
                    <td>
                        <input type="text" name="txtStrike" id="txtStrike" value="0" />
                        <span id="optionCurrency"></span>
                    </td>
                </tr>
                <tr>
                    <td>
                        Premium
                    </td>
                    <td>
                        <input type="text" name="txtPremium" id="txtPremium" value="0" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Exercise Type
                    </td>
                    <td>
                        <div class="radio">
                            <input type="radio" name="txtExerciseType" id="txtExerciseTypeCash" value="Cash" /><label
                                for="txtExerciseTypeCash">Cash</label><input type="radio" name="txtExerciseType"
                                    id="txtExerciseTypePhysical" value="Physical" checked="checked" /><label for="txtExerciseTypePhysical">Physical</label></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <span id="lblOptionMsg" class="AlertText"></span>
                        <input type="reset" class="button" />
                        <input type="button" id="btnPrice" value="Price..." class="button" name="btnPrice" />
                        <input type="button" id="btnSaveOption" value="Save" class="button" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div id="priceOptionDialog" title="Price Option">
        <table border="0" cellpadding="2" cellspacing="2">
             <tr>
                <td>
                    Value Date
                </td>
                <td>
                    <input type="text" name="txtPricerValueDate" id="txtPricerValueDate" class="datepicker" />
                </td>
            </tr>
            <tr>
                <td>
                    Vesting Date
                </td>
                <td>
                    <input type="text" name="" id="txtPricerVestingDate" class="datepicker" />
                </td>
            </tr>
             <tr>
                <td>
                    Maturity Date
                </td>
                <td>
                    <input type="text" name="" id="txtPricerMaturityDate" class="datepicker" />
                </td>
            </tr>
            <tr>
                <td>
                    Stock price
                </td>
                <td>
                    <input type="text" name="" id="txtStockPrice" />
                </td>
            </tr>
            <tr>
                <td>
                    Strike
                </td>
                <td>
                    <input type="text" name="" id="txtPricerStrike" />
                </td>
            </tr>
            <tr>
                <td>
                    Growth Rate(%)
                </td>
                <td>
                    <input type="text" name="" id="txtPricerGrowthRate" />
                </td>
            </tr>
            <tr>
                <td>
                    Dividend Yield(%)
                </td>
                <td>
                    <input type="text" name="" id="txtPricerDividendYield" />
                </td>
            </tr>
            <tr>
                <td>
                    Volatility(%)
                </td>
                <td>
                    <input type="text" name="" id="txtPricerVolatility" />
                </td>
            </tr>
            
            <tr>
                <td>
                    Loss rate
                </td>
                <td>
                    <input type="text" name="" id="txtPricerLossRate" value="0" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">enter the quantity - otherwise all will be 0
                    <input type="button" id="btnPriceOption" name="" value="Price" class="button" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    
                    <span id="lblOptionPriceMsg" class="AlertText"></span>
                </td>
            </tr>
            
        </table>
    </div>
</asp:Content>
